Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
How to prevent parent div to flex in vertical direction while one of the child item flexes?[ReactJS]

So far I implemented this as below.

This is a div inside a ReactJs component:

                <div className='ChatAreaClass' as={InputMessage} style={{
                    display: "flex",
                    flexDirection: "row",
                    borderTop: "1px dashed #d1dbe4",
                    alignItems: 'end',
                    marginBottom: "5px"
                }}>
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${stickersIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${gifIcon})`}}
                    />
                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${emojiIcon})`}}
                    />

                    <textarea onChange={e => setTextAreaAutosize(e)}
                        className='form-control text-area' 
                        value={chatMessage} placeholder='write here ...'>
                    </textarea>

                    <Button className='chat-btn'
                        style={{backgroundImage: `url(${arrowIcon})`}}
                    />
                </div>

css:

.ChatAreaClass {
    text-align: left;
    border-top: unset !important;
    margin-top: 0px;
}

.text-area {
    margin-left: 5px;
    margin-right: 6px;
    margin-bottom: 4px;
    border-radius: 10px;
    overflow: clip;
    margin-top: 5px;
    resize: none;
    border-color: #2200ff;
    max-height:200px;
    scrollbar-width: none;
}

Output:

enter image description here

Now, facing problem for the chat input text-area.

For a large input text messages, It hides the incoming messages. enter image description here

Expected Output is:

enter image description here

How can I achieve this? should I make 3 different div or, it is possible in some other way?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!